Conversation
…, to short circuit save_post filters
|
@willmot Right, I've fixed the inception bug with It does work - I've tested by creating posts in admin and inspecting DB. However, what I'm struggling with is writing a correct unit test for it, as it's just a specific situation.. I added a description to a test function here https://github.com/humanmade/repeatable-posts/pull/36/files#diff-68c93200956e8ea5794540280359255fR207 If you have any thoughts how to correctly test this or perhaps how to refactor code, so it's easier to test this, please let me know :) |
|
Perhaps we need to merge 2 functions hooked in into |
|
@willmot should we have some kind of script to cleanup the meta data for Repeat posts? I think we should, otherwise count of them will be incorrect in admin. Any pointes on how to do that? |
| * in code inception - that in turn uses $_POST global as a deciding condition whether | ||
| * to save a meta data or not. | ||
| * | ||
| * We need to replicate a live environment conditions with $_POST global. |
There was a problem hiding this comment.
I haven’t fully grasped this, but could we just manually set the $_POST superglobal match the live environment?
Sounds like a good fit for a one time upgrade routine. We used those in BackUpWordPress to run one-time scripts when the plugin was upgraded to a new version. See https://github.com/humanmade/backupwordpress/blob/6a0729633e28567f846197e7050b6ef5a9bfae38/functions/core.php#L9 for the code on BWP. But, basically we’d just need to start storing the version of the plugin as an option and as a constant in the code. Then you can have an if statement which compares the Constant with the option and if the Constant is higher then the plugin must have been updated. You can then run the code you want to run once and then before closing the if statement, update the option to match the version number in Constant. |
Yeah that sounds sensible |
…, do Repeat post clean up/refresh on Repeating post change
|
Will carry on with fixing tests 🎉 |
No description provided.